<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
		<h1>我是父组件的标题</h1>
		<my-component>
			
		</my-component>
	</div>
    
	<template id="temp">
		<div>
			<h2>我是子组件的标题</h2>
			<slot>
				<p>如果父组件没用插入内容,我将作为默认出现</p>
			</slot>
		</div>
	</template>

	<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		Vue.component('my-component', {
			template: '#temp',
		})
		new Vue({
			el: '#app'
		})
	</script>

    
</body>
</html>